//
//  HTVideoMainListModel.m
//  HeartTravel
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "HTVideoMainListModel.h"

@implementation HTVideoMainListModel
- (instancetype)init{
    self = [super init];
    if (self) {
        _tagsArray = [NSMutableArray arrayWithCapacity:0];
        _u = [[HTUModel alloc]init];
        _video = [[HTVideoModel alloc]init];
        _top_comment = [[HTTop_comment alloc]init];
        _share_info = [[HTShare_info alloc]init];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key{
    if ([key isEqualToString:@"tags"]) {
        for (NSDictionary *dict in value) {
            HTTagsModel *model = [[HTTagsModel alloc]init];
            [model setValuesForKeysWithDictionary:dict];
            [self.tagsArray addObject:model];
        }
    }else if ([key isEqualToString:@"u"]){
        [_u setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"video"]){
        [_video setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"top_comment"]){
        [_top_comment setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"share_info"]){
        [_share_info setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"comment"]){
        if ([value isKindOfClass:[NSString class]]) {
            self.comment = value;
        }else{
            self.comment = [NSString stringWithFormat:@"%@", value];
        }
    }else{
        [super setValue:value forKey:key];
    }
}
@end
